/*            Copyright(c) 2006-2008 Dave Sexton           *
 * http://www.codeplex.com/DocProject                      *
 * http://www.codeplex.com/DocProject/Project/License.aspx *
 ***********************************************************/
using System;
using System.Collections.Generic;
using System.Text;

namespace DaveSexton.DocProject
{
	[AttributeUsage(AttributeTargets.Property, AllowMultiple=false, Inherited=false)]
	public sealed class SortedPropertyAttribute : Attribute
	{
		#region Public Properties
		[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Security", "CA2104:DoNotDeclareReadOnlyMutableReferenceTypes")]
		public static readonly SortedPropertyAttribute Default = new SortedPropertyAttribute(0);

		public int SortIndex
		{
			get
			{
				return sortIndex;
			}
		}
		#endregion

		#region Private / Protected
		private int sortIndex;
		#endregion

		#region Constructors
		/// <summary>
		/// Constructs a new instance of the <see cref="SortedPropertyAttribute" /> class.
		/// </summary>
		public SortedPropertyAttribute(int sortIndex)
		{
			this.sortIndex = sortIndex;
		}
		#endregion

		#region Methods
		public override bool IsDefaultAttribute()
		{
			return sortIndex == 0;
		}
		#endregion
	}
}
